home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / patchSG0003743.idb / usr / include / cray / fndc.h.z / fndc.h
C/C++ Source or Header  |  2001-04-12  |  5KB  |  148 lines

  1. /* USMID @(#) clibinc/cray/fndc.h    92.1    06/16/99 17:29:56 */
  2. /*
  3.  *    (C) COPYRIGHT CRAY RESEARCH, INC.
  4.  *    UNPUBLISHED PROPRIETARY INFORMATION.
  5.  *    ALL RIGHTS RESERVED.
  6.  */
  7.  
  8. #ifndef _FNDC_H
  9. #define _FNDC_H
  10.  
  11. /*
  12.  * Definitions for Fortran Numeric Data Conversion
  13.  *
  14.  * This information is used in assign processing (libu) and in
  15.  * Fortran unformatted I/O (libf).
  16.  */
  17.  
  18. /* Define which systems support numeric data conversion */
  19.  
  20. #if    defined(_UNICOS) || defined(__mips)
  21. #define    NUMERIC_DATA_CONVERSION_ENABLED    1
  22. #else
  23. #define    NUMERIC_DATA_CONVERSION_ENABLED    0
  24. #endif
  25.  
  26. /*
  27.  * Define numeric data conversion types.  These types are used
  28.  * to index into various tables.
  29.  */
  30.  
  31. #define NCV_NONE    0    /* No data conversion */
  32. #define NCV_CRAY    1    /* CRAY classic */
  33. #define NCV_IBM        2    /* IBM */
  34. #define NCV_CDC        3    /* CDC 60-bit */
  35. #define NCV_VMS        4    /* DEC VAX/VMS */
  36. #define NCV_IEG        5    /* IEEE Generic (32-/64-bit) */
  37. #define NCV_NVE        6    /* CDC 64-bit */
  38. #define NCV_205        7    /* CDC Cyber 205 */
  39. #define NCV_IEU        8    /* DEC Ultrix (IEG little-endian) */
  40. #define NCV_IED        9    /* IEG, but with double-precision folded to single */
  41. #define NCV_USER    10    /* User defined conversion */
  42. #define NCV_SITE    11    /* Site defined conversion */
  43. #define NCV_IBD        12    /* IBM, but with double-precision folded to single */
  44. #define NCV_VAD        13    /* VMS, but with double-precision folded to single */
  45. #define NCV_IUD        14    /* IEU, but with double-precision folded to single */
  46. #define NCV_T3D        15    /* CRAY T3D/T3E */
  47.                 /* (64-bit IEEE with no double-precision or denorms) */
  48. #define NCV_IEL        16    /* IEEE Large (64-/128-bit) */
  49. #define NCV_MIPS    17    /* MIPS (SGI) format */
  50.  
  51. #define NCV_MAX        18    /* 1 greater than max type number */
  52.  
  53. /*
  54.  * Define character set types.
  55.  */
  56.  
  57. #define CS_NONE        0    /* No character set conversion */
  58. #define CS_ASCII    1    /* ASCII */
  59. #define CS_EBCDIC    2    /* IBM EBCDIC */
  60. #define CS_CDC        3    /* CDC 6-bit display code */
  61. #define CS_USER        4    /* User defined conversion, deferred */
  62. #define CS_SITE        5    /* Site defined conversion, deferred */
  63.  
  64. #define CS_MAX        6    /* 1 greater than max type number */
  65.  
  66. /*
  67.  * Define native types.
  68.  */
  69.  
  70. #ifdef    _CRAY1
  71. # ifdef    _CRAYIEEE
  72. # define NCV_NATIVE    NCV_IEL        /* cray-ts,ieee */
  73. # else
  74. # define NCV_NATIVE    NCV_CRAY    /* cray-ts, cray-c90, etc. */
  75. # endif
  76.  
  77. #elif    defined(_CRAYMPP)
  78. #define NCV_NATIVE    NCV_T3D        /* cray-t3d, cray-t3e, etc. */
  79.  
  80. #elif    defined(_MIPSEB)
  81. #define NCV_NATIVE    NCV_MIPS    /* MIPS */
  82.  
  83. #elif    defined(_WORD32)
  84. #define NCV_NATIVE    NCV_IEG        /* 32-bit platforms */
  85.  
  86. #endif
  87.  
  88. #define CS_NATIVE    CS_ASCII
  89.  
  90. /*
  91.  * This structure is used to build tables of conversion functions
  92.  * indexed by the above NCV data conversion types.  The flags are
  93.  * used to indicate how the functions are to be called, or to
  94.  * indicate special operations that may apply to a broader class
  95.  * of conversions.
  96.  */
  97.  
  98. struct c_funs_s {
  99.     int    (* to_native)();    /* Foreign-to-native conversion    */
  100.     int    (* to_foreign)();    /* Native-to-foreign conversion    */
  101.     unsigned new_style_func:1;    /* 1 if new-style conv. func.    */
  102.     unsigned cray_int_compat:1;    /* 1 if ints are cray identical    */
  103.                     /* (twos complment, big-endian)    */
  104.     unsigned no_ieee_denorms:1;    /* 1 if no ieee denorms allowed    */
  105. };
  106.  
  107. /*
  108.  * This structure is used to determine the length in bits of the
  109.  * appropriate data types.  The first word is the number of valid
  110.  * words in the array of type lengths.  The following words correspond
  111.  * to the lengths of the data items of each type.  Note that this
  112.  * structure is used for old-style (Fortran 77) conversion routines
  113.  * and new-style (Fortran 90) conversion routines.  In the later case,
  114.  * it represents the default size of the various types.
  115.  */
  116.  
  117. struct _dsz_s {
  118.     int    numtypes;    /* number of types in the table */
  119.     int    typlen[9];    /* length of each type (normally 8 types) */
  120. };
  121.  
  122. /*
  123.  * This structure is used to determine a granularity for each numeric type.
  124.  * The flag states whether alignment should be performed when reading/writing
  125.  * noncharacter items.  The granularity is roughly the 'word' size.
  126.  * padval is the desired padd value when aligning.  No conversion will
  127.  * performed on this word before being written.
  128.  */
  129.  
  130. struct _dal_s {
  131.     unsigned    pflag:1;    /* Padd flag */
  132.     int        unu:31;        /* Unused */
  133.     int        gran:32;    /* Granularity */
  134.     long long    padval;        /* Usually a word of blanks */
  135. };
  136.  
  137. /*
  138.  * External arrays
  139.  */
  140.  
  141. extern struct    c_funs_s    __fndc_ncfunc [NCV_MAX];
  142. extern struct    _dsz_s        *__fndc_f77sz [NCV_MAX];
  143. extern struct    _dsz_s        *__fndc_f90sz [NCV_MAX];
  144. extern struct    _dal_s        *__fndc_align [NCV_MAX];
  145. extern         int        __fndc_charsz [CS_MAX];
  146.  
  147. #endif    /* !_FNDC_H */
  148.